﻿<UserControl
  x:Class="Renren.Controls.NewsBox"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  mc:Ignorable="d"
  FontFamily="{StaticResource PhoneFontFamilyNormal}"
  FontSize="{StaticResource PhoneFontSizeNormal}"
  Foreground="{StaticResource PhoneForegroundBrush}"
  d:DataContext="{d:DesignData /SampleData/NewsViewModel.xaml}">
    
  <Grid x:Name="LayoutRoot">
    <StackPanel Orientation="Horizontal">
      <Image x:Name="HeadPhoto" Source="{Binding HeadUrl}"
             Height="50" Width="50" VerticalAlignment="Top" Margin="8,6,0,0" />
      <StackPanel Width="400">
        <StackPanel Orientation="Horizontal">
          <StackPanel  Width="390">
            <TextBlock x:Name="NameField" Text="{Binding Name}"
                       TextWrapping="Wrap" FontSize="26" 
                       Style="{StaticResource PhoneTextExtraLargeStyle}"
                       HorizontalAlignment="Left" />
            <TextBlock Text="{Binding UpdateTime}"
                       Style="{StaticResource PhoneTextSubtleStyle}"
                       HorizontalAlignment="Left" />
            <RichTextBox x:Name="RichTitleField" Padding="0,0,0,6">
              <Paragraph>
                <Run x:Name="NewsTypeRun" Text="{Binding NewsType}" />
                <Run Text="|" Foreground="#C0858685" FontWeight="Bold" FontSize="24" />
                <Span x:Name="RichTitle" />
              </Paragraph>
            </RichTextBox>
          </StackPanel>
          <Grid x:Name="CommentField" Margin="-70,0,0,0"
                HorizontalAlignment="Right"
                VerticalAlignment="Top" Background="#00FF">
            <Rectangle Width="50" Height="42" StrokeThickness="3" Opacity="0.5">
              <Rectangle.Stroke>
                <LinearGradientBrush StartPoint="0,1" EndPoint="1,0">
                  <GradientStop Color="#C0858685" Offset="0.15" />
                  <GradientStop Color="Transparent" Offset="0.15" />
                  <GradientStop Color="Transparent" Offset="0.85" />
                  <GradientStop Color="#C0858685" Offset="0.85" />
                </LinearGradientBrush>
              </Rectangle.Stroke>
            </Rectangle>
            <TextBlock Text="{Binding CommentCount}"
                       FontSize="26" Margin="1,2,0,0"
                       HorizontalAlignment="Center" />
          </Grid>
        </StackPanel>
        <StackPanel x:Name="PhotosField" Visibility="{Binding PhotoStackPanel}"
                    Width="390" Margin="0,12,0,0" Orientation="Horizontal"
                    HorizontalAlignment="Left">
          <Image Source="{Binding Photo0_Url}" Margin="12,0,8,0" Height="80"/>
          <Image Source="{Binding Photo1_Url}" Margin="12,0,8,0" Height="80"/>
          <Image Source="{Binding Photo2_Url}" Margin="12,0,8,0" Height="80"/>
          <Image Source="{Binding Photo3_Url}" Margin="12,0,8,0" Height="80"/>
        </StackPanel>
        <TextBlock x:Name="ContentField"
                   Text="{Binding Content}" TextWrapping="Wrap" Margin="12,6,12,0"
                   Visibility="{Binding ContentPanel}"
                   Style="{StaticResource PhoneTextSubtleStyle}" HorizontalAlignment="Left" />
      </StackPanel>
    </StackPanel>
  </Grid>
</UserControl>
